# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AdSenseHost.V41.Model.AssociationSession do
  @moduledoc """


  ## Attributes

  *   `accountId` (*type:* `String.t`, *default:* `nil`) - Hosted account id of the associated publisher after association. Present if status is ACCEPTED.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Unique identifier of this association session.
  *   `kind` (*type:* `String.t`, *default:* `adsensehost#associationSession`) - Kind of resource this is, in this case adsensehost#associationSession.
  *   `productCodes` (*type:* `list(String.t)`, *default:* `nil`) - The products to associate with the user. Options: AFC, AFG, AFV, AFS (deprecated), AFMC (deprecated)
  *   `redirectUrl` (*type:* `String.t`, *default:* `nil`) - Redirect URL of this association session. Used to redirect users into the AdSense association flow.
  *   `status` (*type:* `String.t`, *default:* `nil`) - Status of the completed association, available once the association callback token has been verified. One of ACCEPTED, REJECTED, or ERROR.
  *   `userLocale` (*type:* `String.t`, *default:* `nil`) - The preferred locale of the user themselves when going through the AdSense association flow.
  *   `websiteLocale` (*type:* `String.t`, *default:* `nil`) - The locale of the user's hosted website.
  *   `websiteUrl` (*type:* `String.t`, *default:* `nil`) - The URL of the user's hosted website.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accountId => String.t() | nil,
          :id => String.t() | nil,
          :kind => String.t() | nil,
          :productCodes => list(String.t()) | nil,
          :redirectUrl => String.t() | nil,
          :status => String.t() | nil,
          :userLocale => String.t() | nil,
          :websiteLocale => String.t() | nil,
          :websiteUrl => String.t() | nil
        }

  field(:accountId)
  field(:id)
  field(:kind)
  field(:productCodes, type: :list)
  field(:redirectUrl)
  field(:status)
  field(:userLocale)
  field(:websiteLocale)
  field(:websiteUrl)
end

defimpl Poison.Decoder, for: GoogleApi.AdSenseHost.V41.Model.AssociationSession do
  def decode(value, options) do
    GoogleApi.AdSenseHost.V41.Model.AssociationSession.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AdSenseHost.V41.Model.AssociationSession do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
